import Vue from 'vue'
import Router from 'vue-router'
// 组件
import standardTable from '@/home/standardTable'
import editTable from "@/home/editTable"
import parentChildTable_v2 from "@/home/parentChildTable_v2"
// 模板
// import HelloWorld from '@/components/HelloWorld'
import home from "@/pages/home";
import ParentChildTable from '@/home/parentChildTable'
import ParentChildlr from '@/home/parentchildlr'
import ParentChildtree from '@/home/parentchildtree'
import ParentChildtreeV1 from '@/home/parentchildtree_v1'
import ParentChildtreeV2 from '@/home/parentchildtree_v2'
import TreeTable from '@/home/treeTable'
import center from "@/pages/center"
import StandardTemplate from '@/home/StandardTemplate'
import EditTemplate from '@/home/EditTemplate'
import FormTemplate from '@/home/FormTemplate'
import EleUpload from '@/home/EleUpload'
import ParentChildTemplate from '@/home/ParentChildTemplate'
import count from '@/components/countDown'
// import Editor from '@/components/editorModule'
// import EchartPillar from '@/components/echartsTemplate/echartsPillar'
import treeLoadTemplate from '@/home/treeLoadTemplate'
// import pages from '@/pages/pages'
import treePageTable from "@/home/treePageTable"
import dateTemplate from "@/components/dateTemplate"
import dragTemplate from "@/home/dragTemplate"
import treeTableNode from "@/home/treeTableNode"
import moreTableTemplate from "@/home/moreTable"
import templateTable from "@/home/templateTable"
import swiper from "@/components/swiper1"
import swiperTemplate from "@/home/swiperTemplate"
import echartsTemplate from "@/pages/echart"
import tableAttribuatiue from "@/home/tableAttribuatiue"
import echartsExam from "@/pages/echartsExam"
import echartsTree from "@/pages/echartsTree"
import pieCharts from "@/home/pieCharts"
import pieCharts1 from "@/home/echart/pieCharts1"
import foldLine from "@/home/foldLine"
import barCharts from "@/home/barCharts"
import curveCharts from "@/home/curveCharts"
import barCharts1 from "@/home/barCharts1"
import treeCharts from "@/home/treeCharts"
import gaugeCharts from "@/home/gaugeCharts"
import form  from "@/pages/form"
// import jtdemo from "@/pages/jtdemo"
// import taskTodo from "@/pages/taskTodo"
// import myLaunch from "@/pages/myLaunch"
// import superHotWork from "@/pages/hotWork/super-hotWork"
// import superPrint from "@/pages/hotWork/superPrint"
// import liftingPage from "@/pages/dangerItem/liftingPage"
// import highWork from "@/pages/dangerItem/highWork"
// import electricity from "@/pages/dangerItem/electricity"
// import blind from "@/pages/dangerItem/Blind"
// import safetyProtection from "@/pages/dangerItem/safetyProtection"
// import largeDelivery from "@/pages/dangerItem/largeDelivery"
// import limitSpace from "@/pages/dangerItem/limitSpace"
// import spacePeople from "@/pages/dangerItem/spacePeople"
import componentsCanvas  from "@/pages/componentsCanvas"
Vue.use(Router)

// 解决重复点击路由报错的BUG
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch((err) => err)
}

export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      component: home
    },
    {
      path: '/com',
      name: 'componentsCanvas',
      component: componentsCanvas
    },

    {
      path: '/count',
      name: 'count',
      component: count
    },
    {
      path:"/templateTable",
      name: 'templateTable',
      component: templateTable
    },
    {
      path:"/echartsTemplate",
      name: 'echartsTemplate',
      component: echartsTemplate
    },
    {
      path:"/echartsExam",
      name:"echartsExam",
      component:echartsExam
    },
    {
      path:"/echartsTree",
      name:"echartsTree",
      component:echartsTree
    },
    {
      path:"/form",
      name:"form",
      component:form
    },
    // {
    //   path:"/jtdemo",
    //   name:"jtdemo",
    //   component:jtdemo
    // },
    // {
    //   path:"/taskTodo",
    //   name:"taskTodo",
    //   component:taskTodo
    // },
    // {
    //   path:"/myLaunch",
    //   name:"myLaunch",
    //   component:myLaunch
    // },

    // {
    //   path:"/superPrint",
    //   name:"superPrint",
    //   component:superPrint
    // },
    // {
    //   path:"/superHotWork",
    //   name:"superHotWork",
    //   component:superHotWork
    // },{
    //     path:"/liftingPage",
    //   name: 'liftingPage',
    //   component: liftingPage,
    // }
    // ,{
    //     path:"/highWork",
    //   name: 'highWork',
    //   component: highWork,
    // }
    // ,{
    //   path:"/electricity",
    //   name: 'electricity',
    //   component: electricity,
    // },
    // ,{
    //   path:"/blind",
    //   name: 'blind',
    //   component: blind,
    // },
    // {
    //   path:"/limitSpace",
    //   name: 'limitSpace',
    //   component: limitSpace,
    // },
    // {
    //   path:"/safetyProtection",
    //   name: 'safetyProtection',
    //   component: safetyProtection,
    // },
    // {
    //   path:"/largeDelivery",
    //   name: 'largeDelivery',
    //   component: largeDelivery,
    // },{
    //   path:"/spacePeople",
    //   name: 'spacePeople',
    //   component: spacePeople,
    // },
    {
      // smallMap
      path:"/smallMap",
      name: 'smallMap',
      component:()=>import('@/pages/smallMap'),
    },
     // 竞拍导出exportPage
    //  {
    //   path:"/exportPage",
    //   name: 'exportPage',
    //   component:()=>import('@/pages/exportPage'),
    // },
    
    {
      path:"/center",
      name:"center",
      component: center,
      redirect: {name: "standardTable"},   //输入路由center会重定向到a页面
      children:
        [
          // 组件
          {
            path:'/standardTable',
            name: 'standardTable',
            component: standardTable
          },
          {
            path:"/editTable",
            name:"editTable",
            component:editTable
          },
          {
            path: '/parentChildTable_v2',
            name: 'parentChildTable_v2',
            component: parentChildTable_v2
          },
          // 模板
          {
            path: '/StandardTemplate',
            name: 'StandardTemplate',
            component: StandardTemplate
          },
          {
            path: '/EditTemplate',
            name: 'EditTemplate',
            component: EditTemplate
          },
          {
            path: '/lrTable',
            name: 'ParentChildlr',
            component: ParentChildlr
          },
          {
            path: '/parentchildtree',
            name: 'ParentChildtree',
            component: ParentChildtree
          },
          {
            path: '/parentchildtree_v1',
            name: 'parentchildtree_v1',
            component: ParentChildtreeV1
          },
          {
            path: '/parentchildtree_v2',
            name: 'parentchildtree_v2',
            component: ParentChildtreeV2
          },
          {
            path: '/treeTable',
            name: 'TreeTable',
            component: TreeTable
          },
          {
            path: '/ParentChildTable',
            name: 'ParentChildTable',
            component: ParentChildTable
          },
          {
            path: '/FormTemplate',
            name: 'FormTemplate',
            component: FormTemplate
          },
          {
            path: '/EleUpload',
            name: 'EleUpload',
            component: EleUpload
          },
          {
            path: '/ParentChildTemplate',
            name: 'ParentChildTemplate',
            component: ParentChildTemplate
          },
          {
            path:"/treeLoadTemplate",
            name: 'treeLoadTemplate',
            component: treeLoadTemplate
          },
          {
            path: '/dateTemplate',
            name: 'dateTemplate',
            component: dateTemplate
          },
          {
            path: '/dragTemplate',
            name: 'dragTemplate',
            component: dragTemplate
          },
          {
            path: '/treePageTable',
            name: 'treePageTable',
            component: treePageTable
          },
          {
            path:'/treeTableNode',
            name: 'treeTableNode',
            component: treeTableNode
          },
          {
            path:"/moreTableTemplate",
            name: 'moreTableTemplate',
            component: moreTableTemplate
          },
          // 竞拍导出exportPage
          {
            path:"/exportPage",
            name: 'exportPage',
            component:()=>import('@/pages/exportPage'),
          },

          {
            path:"/swiper",
            name:'swiper',
            component:swiper
          },
          {
            path:"/swiperTemplate",
            name: 'swiperTemplate',
            component: swiperTemplate,
          },
          {
            path:"/tableAttribuatiue",
            name: 'tableAttribuatiue',
            component: tableAttribuatiue,
          },
          {
            path:"/pieCharts",
            name: 'pieCharts',
            component: pieCharts,
          },{
            path:"/pieCharts1",
            name: 'pieCharts1',
            component: pieCharts1,
          },{
            path:"/foldLine",
            name: 'foldLine',
            component: foldLine,
          }
          ,{
            path:"/barCharts",
            name: 'barCharts',
            component: barCharts,
          }
          ,{
            path:"/barCharts1",
            name: 'barCharts1',
            component: barCharts1,
          },{
            path:"/curveCharts",
            name: 'curveCharts',
            component: curveCharts,
          },{
            path:"/treeCharts",
            name: 'treeCharts',
            component: treeCharts,
          },{
            path:"/gaugeCharts",
            name: 'gaugeCharts',
            component: gaugeCharts,
          }
        ]
    },
  ]
})
